}
GdkDeviceTool *
-gdk_seat_get_tool (GdkSeat *seat,
- guint64 serial,
- guint64 hw_id)
+gdk_seat_get_tool (GdkSeat *seat,
+ guint64 serial,
+ guint64 hw_id,
+ GdkDeviceToolType type)
{
GdkDeviceTool *match = NULL;
GList *tools, *l;
{
GdkDeviceTool *tool = l->data;
- if (tool->serial == serial && tool->hw_id == hw_id)
+ if (tool->serial == serial && tool->hw_id == hw_id && tool->type == type)
{
match = tool;
break;
priv = gdk_seat_default_get_instance_private (seat);
- if (tool != gdk_seat_get_tool (GDK_SEAT (seat), tool->serial, tool->hw_id))
+ if (tool != gdk_seat_get_tool (GDK_SEAT (seat), tool->serial, tool->hw_id, tool->type))
return;
g_signal_emit_by_name (seat, "tool-removed", tool);
GdkDeviceTool *tool);
GdkDeviceTool *
- gdk_seat_get_tool (GdkSeat *seat,
- guint64 serial,
- guint64 hw_id);
+ gdk_seat_get_tool (GdkSeat *seat,
+ guint64 serial,
+ guint64 hw_id,
+ GdkDeviceToolType type);
GdkGrabStatus gdk_seat_grab (GdkSeat *seat,
GdkSurface *surface,
if (ev->what != XIPropertyDeleted &&
device_get_tool_serial_and_id (device, &serial_id, &tool_id))
{
+ GdkDeviceToolType tool_type;
+
seat = gdk_device_get_seat (device);
- tool = gdk_seat_get_tool (seat, serial_id, tool_id);
+ tool_type = device_get_tool_type (device);
- if (!tool && serial_id > 0)
+ if (tool_type != GDK_DEVICE_TOOL_TYPE_UNKNOWN)
{
- GdkDeviceToolType tool_type;
+ tool = gdk_seat_get_tool (seat, serial_id, tool_id, tool_type);
- tool_type = device_get_tool_type (device);
- if (tool_type != GDK_DEVICE_TOOL_TYPE_UNKNOWN)
+ if (!tool && serial_id > 0)
{
tool = gdk_device_tool_new (serial_id, tool_id, tool_type, 0);
gdk_seat_default_add_tool (GDK_SEAT_DEFAULT (seat), tool);